package cn.bone.ou.scheduled.job;

import cn.bone.ou.vote.mapper.VoteInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
@Slf4j
public class VoteJob {

    @Resource
    private VoteInfoMapper infoMapper;

    /**每分钟执行一次,刷新投票状态*/
    public void execute(){
        int startCount = infoMapper.updateStart();
        int endCount = infoMapper.updateEnd();
        log.info("更新投票状态, ["+startCount+"]未开始==>进行中,  ["+endCount+"]进行中==>已结束");
    }
}
